package com.applet.pojo.entity;

import com.applet.handler.ListStringTypeHandler;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.apache.ibatis.type.JdbcType;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author “XuShao”
 * @date 2024/12/15 17:41
 * @description
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Accessors(chain = true)
public class Activity extends BaseEntity {
    // 0，结束，1，未开始，2，正在进行

    public static final Integer CANCELED = 0;
    public static final Integer HAVE_NOT_STARTED = 1;
    public static final Integer UNDERWAY = 2;

    @Schema(description = "活动标题")
    private String title;// 标题

    @Schema(description = "活动添加者")
    private String userId;// 添加者

    @Schema(description = "活动描述")
    private String description;// 描述

    @Schema(description = "活动开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GHT+8")
    private LocalDateTime beginTime;// 开始时间

    @Schema(description = "活动结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GHT+8")
    private LocalDateTime endTime;// 结束时间

    @Schema(description = "活动活动状态")
    private Integer state;// 活动状态

    @Schema(description = "活动活动地点")
    private String place;// 活动地点

    @Schema(description = "活动参与人数上限")
    private Integer numberOfPeopleUpperLimit;// 参与人数上限

    @Schema(description = "活动当前参与人数")
    private Integer numberOfParticipants;// 当前参与人数

    @Schema(description = "活动分类id")
    private String classifyId;// 活动分类id

    @Schema(description = "活动图片地址")
    @TableField(typeHandler = ListStringTypeHandler.class)
    private List<String> avatarUrl; // 活动图片

    @Schema(description = "活动参与的对象")
    private Short target;  // 活动参与的对象

    @Schema(description = "活动报名方式")
    private Short registrationMethod;  // 报名方式

    @Schema(description = "活动活动签到方式")
    private Short signInMethod;  // 活动签到方式

    @Schema(description = "活动活动签退方式")
    private Short signOutMethod;  // 活动签退方式

    @Schema(description = "活动联系人姓名")
    private String contactName;  // 联系人姓名

    @Schema(description = "活动联系人电话")
    private String contactPhone; // 联系人电话
}
